package com.durian.base.update.proxy.impl

import com.durian.base.update.entity.DownloadEntity
import com.durian.base.update.entity.VersionEntity
import com.durian.base.update.entity.XUpdateException
import com.durian.base.update.proxy.IUpdateInstallController
import com.durian.base.update.proxy.IUpdateListener
import com.durian.base.update.proxy.IUpdateVersionController

open class DefaultUpdateListener : IUpdateListener {

    override fun doCheckUpdateBefore() {
    }

    override fun doCheckUpdateAfter() {
    }

    override fun doCheckUpdateException(exception: XUpdateException) {
    }

    override fun isDownloading() {
    }

    override fun noNewVersion() {
    }

    override fun findNewVersion(updateController: IUpdateVersionController, versionEntity: VersionEntity) {
        updateController.download(versionEntity)
    }

    override fun installNewVersion(updateController: IUpdateInstallController, downloadEntity: DownloadEntity) {
        updateController.install(downloadEntity)
    }

    override fun doDownloadApkBefore() {
    }

    override fun doDownloadApkAfter() {
    }

    override fun doDownloadApkException(exception: XUpdateException) {
    }

    override fun doDownloadApkProgress(progress: Int, current: Long, total: Long) {
    }

}